import Layout from '@/views/layout.vue'
import Collect from '@/views/collect.vue'
import Like from '@/views/like.vue'
import User from '@/views/user.vue'
import Article from '@/views/article.vue'

import Detail from '@/views/article-detail.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/article',
    //配置二级路由规则
    children: [
      {
        name: 'article',
        path: 'article',
        component: Article,
      },
      {
        path: 'user',
        component: User,
      },
      {
        path: 'like',
        component: Like,
      },
      {
        path: 'collect',
        component: Collect,
      },
    ],
  },
  {
    name: 'detail',
    path: '/detail',
    component: Detail,
  },
]

export default routes
